/*

Copyright 2007 Renaun Erickson (http://renaun.com)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

@ignore
*/
package asfslib.api.familytree.v1
{

/**
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="event">
 *   &lt;complexContent>
 *     &lt;extension base="{http://api.familysearch.org/familytree/v1}occurringAssertion">
 *       &lt;sequence>
 *         &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="spouse" type="{http://api.familysearch.org/familytree/v1}personReference" minOccurs="0"/>
 *         &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *       &lt;/sequence>
 *       &lt;attribute name="type" type="{http://api.familysearch.org/familytree/v1}eventType" />
 *     &lt;/extension>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
public class EventAssertion extends OccurringAssertion
{
    //----------------------------------
    //  description
    //----------------------------------

    /**
     *  @private
     *  Storage for the description property.
     */
    private var _description:String = "";

    /**
     *  The description property
     *
     *  @default  = ""
     */
    public function get description():String
    {
        return _description;
    }

    /**
     *  @private
     */
    public function set description(value:String):void
    {
        _description = value;
    }


    //----------------------------------
    //  spouse
    //----------------------------------

    /**
     *  @private
     *  Storage for the spouse property.
     */
    private var _spouse:PersonReference;

    /**
     *  The spouse property
     *
     *  @default 
     */
    public function get spouse():PersonReference
    {
        return _spouse;
    }

    /**
     *  @private
     */
    public function set spouse(value:PersonReference):void
    {
        _spouse = value;
    }


    //----------------------------------
    //  title
    //----------------------------------

    /**
     *  @private
     *  Storage for the title property.
     */
    private var _title:Scope;

    /**
     *  The title property
     *
     *  @default 
     */
    public function get title():Scope
    {
        return _title;
    }

    /**
     *  @private
     */
    public function set title(value:Scope):void
    {
        _title = value;
    }


    //----------------------------------
    //  type
    //----------------------------------

    /**
     *  @private
     *  Storage for the type property.
     */
    private var _type:String = "";

    /**
     *  The type property
     *
     *  @default  = ""
     */
    public function get type():String
    {
        return _type;
    }

    /**
     *  @private
     */
    public function set type(value:String):void
    {
        _type = value;
    }

    //----------------------------------
    //
    //  Methods
    //
    //----------------------------------
	
	/**
	 * 	Make a clone of this instance
	 */
    override public function clone():Assertion
    {
    	var target:EventAssertion = new EventAssertion();
        copy(target);
        return target;
    }	

	/**
	 * 	Make a clone of this instance
	 */
    override protected function copy(target:Assertion):void
    {
    	super.copy(target);
    	var eventAssertion:EventAssertion = target as EventAssertion;
    	
        var newSpouse:PersonReference = null;
        
        if (spouse != null) {
            newSpouse = spouse.clone();
        }
        
        eventAssertion.description = description;
        eventAssertion.spouse = newSpouse;
        eventAssertion.title = title;
        eventAssertion.type = type;
    }


}
}
